const {
  DataTypes
} = require('sequelize');
module.exports = sequelize => {
  const attributes = {
    id: {
      type: DataTypes.BIGINT.UNSIGNED,
      allowNull: false,
      defaultValue: null,
      primaryKey: true,
      autoIncrement: true,
      comment: "自增id",
      field: "id"
    },
    business_type: {
      type: DataTypes.CHAR(180),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "业务类型，字符串（如：订单、钱包充值、会员购买、等...）",
      field: "business_type"
    },
    request_params: {
      type: DataTypes.TEXT,
      allowNull: true,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: "请求参数（数组则json字符串存储）",
      field: "request_params"
    },
    response_data: {
      type: DataTypes.TEXT,
      allowNull: true,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: "响应参数（数组则json字符串存储）",
      field: "response_data"
    },
    business_handle: {
      type: DataTypes.TEXT,
      allowNull: true,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: "业务处理结果（数组则json字符串存储）",
      field: "business_handle"
    },
    request_url: {
      type: DataTypes.TEXT,
      allowNull: true,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: "请求url地址",
      field: "request_url"
    },
    server_port: {
      type: DataTypes.CHAR(10),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "端口号",
      field: "server_port"
    },
    server_ip: {
      type: DataTypes.CHAR(15),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "服务器ip",
      field: "server_ip"
    },
    client_ip: {
      type: DataTypes.CHAR(15),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "客户端ip",
      field: "client_ip"
    },
    os: {
      type: DataTypes.CHAR(20),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "操作系统",
      field: "os"
    },
    browser: {
      type: DataTypes.CHAR(20),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "浏览器",
      field: "browser"
    },
    method: {
      type: DataTypes.CHAR(4),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "请求类型",
      field: "method"
    },
    scheme: {
      type: DataTypes.CHAR(5),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "http类型",
      field: "scheme"
    },
    version: {
      type: DataTypes.CHAR(5),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "http版本",
      field: "version"
    },
    client: {
      type: DataTypes.CHAR(255),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "客户端详情信息",
      field: "client"
    },
    add_time: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "添加时间",
      field: "add_time"
    },
    upd_time: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "更新时间",
      field: "upd_time"
    }
  };
  const options = {
    tableName: "sxo_pay_request_log",
    comment: "",
    indexes: [{
      name: "business_type",
      unique: false,
      type: "BTREE",
      fields: ["business_type"]
    }, {
      name: "add_time",
      unique: false,
      type: "BTREE",
      fields: ["add_time"]
    }]
  };
  const SxoPayRequestLogModel = sequelize.define("sxo_pay_request_log_model", attributes, options);
  return SxoPayRequestLogModel;
};